package com.hcc.gateway.domain.enums;

/**
 * ApiStatusEnum
 *
 * @author shengjun.hu
 * @date 2022/1/5
 */
public enum ApiStatusEnum {
    DRAFT("草稿"),
    ONLINE("已上线"),
    OFFLINE("已下线");

    private final String desc;

    ApiStatusEnum(String desc) {
        this.desc = desc;
    }

    public static ApiStatusEnum getByName(String name) {
        for (ApiStatusEnum value : ApiStatusEnum.values()) {
            if (value.name().equals(name)) {
                return value;
            }
        }
        return null;
    }

    public String getDesc() {
        return desc;
    }
}
